3.35 \(\int \frac{d+e x+f x^2+g x^3+h x^4+i x^5}{\left (1+x^2+x^4\right )^2} \, dx\)

Optimal. Leaf size=194 \[ -\frac{1}{8} \log \left (x^2-x+1\right ) (2 d-f+h)+\frac{1}{8} \log \left (x^2+x+1\right ) (2 d-f+h)+\frac{x \left (x^2 (-(d-2 f+h))+d+f-2 h\right )}{6 \left (x^4+x^2+1\right )}-\frac{\tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right ) (4 d+f+h)}{12 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right ) (4 d+f+h)}{12 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{2 x^2+1}{\sqrt{3}}\right ) (2 e-g+2 i)}{3 \sqrt{3}}+\frac{x^2 (2 e-g-i)+e-2 g+i}{6 \left (x^4+x^2+1\right )} \]

[Out]

(x*(d + f - 2*h - (d - 2*f + h)*x^2))/(6*(1 + x^2 + x^4)) + (e - 2*g + i + (2*e
- g - i)*x^2)/(6*(1 + x^2 + x^4)) - ((4*d + f + h)*ArcTan[(1 - 2*x)/Sqrt[3]])/(1
2*Sqrt[3]) + ((4*d + f + h)*ArcTan[(1 + 2*x)/Sqrt[3]])/(12*Sqrt[3]) + ((2*e - g
+ 2*i)*ArcTan[(1 + 2*x^2)/Sqrt[3]])/(3*Sqrt[3]) - ((2*d - f + h)*Log[1 - x + x^2
])/8 + ((2*d - f + h)*Log[1 + x + x^2])/8

_______________________________________________________________________________________

Rubi [A]  time = 0.403186, antiderivative size = 194, normalized size of antiderivative = 1., number of steps used = 16, number of rules used = 10, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.278 \[ -\frac{1}{8} \log \left (x^2-x+1\right ) (2 d-f+h)+\frac{1}{8} \log \left (x^2+x+1\right ) (2 d-f+h)+\frac{x \left (x^2 (-(d-2 f+h))+d+f-2 h\right )}{6 \left (x^4+x^2+1\right )}-\frac{\tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right ) (4 d+f+h)}{12 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right ) (4 d+f+h)}{12 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{2 x^2+1}{\sqrt{3}}\right ) (2 e-g+2 i)}{3 \sqrt{3}}+\frac{x^2 (2 e-g-i)+e-2 g+i}{6 \left (x^4+x^2+1\right )} \]

Antiderivative was successfully verified.

[In]  Int[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(1 + x^2 + x^4)^2,x]

[Out]

(x*(d + f - 2*h - (d - 2*f + h)*x^2))/(6*(1 + x^2 + x^4)) + (e - 2*g + i + (2*e
- g - i)*x^2)/(6*(1 + x^2 + x^4)) - ((4*d + f + h)*ArcTan[(1 - 2*x)/Sqrt[3]])/(1
2*Sqrt[3]) + ((4*d + f + h)*ArcTan[(1 + 2*x)/Sqrt[3]])/(12*Sqrt[3]) + ((2*e - g
+ 2*i)*ArcTan[(1 + 2*x^2)/Sqrt[3]])/(3*Sqrt[3]) - ((2*d - f + h)*Log[1 - x + x^2
])/8 + ((2*d - f + h)*Log[1 + x + x^2])/8

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 82.3899, size = 175, normalized size = 0.9 \[ \frac{x \left (d + f - 2 h - x^{3} \left (e - 2 g + 1\right ) - x^{2} \left (d - 2 f + h\right ) - x \left (- e - g + 2\right )\right )}{6 \left (x^{4} + x^{2} + 1\right )} - \left (\frac{d}{4} - \frac{f}{8} + \frac{h}{8}\right ) \log{\left (x^{2} - x + 1 \right )} + \left (\frac{d}{4} - \frac{f}{8} + \frac{h}{8}\right ) \log{\left (x^{2} + x + 1 \right )} + \frac{\sqrt{3} \left (4 d + f + h\right ) \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x}{3} - \frac{1}{3}\right ) \right )}}{36} + \frac{\sqrt{3} \left (4 d + f + h\right ) \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x}{3} + \frac{1}{3}\right ) \right )}}{36} - \frac{\sqrt{3} \left (- 2 e + g - 3 i + 1\right ) \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x^{2}}{3} + \frac{1}{3}\right ) \right )}}{9} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4+x**2+1)**2,x)

[Out]

x*(d + f - 2*h - x**3*(e - 2*g + 1) - x**2*(d - 2*f + h) - x*(-e - g + 2))/(6*(x
**4 + x**2 + 1)) - (d/4 - f/8 + h/8)*log(x**2 - x + 1) + (d/4 - f/8 + h/8)*log(x
**2 + x + 1) + sqrt(3)*(4*d + f + h)*atan(sqrt(3)*(2*x/3 - 1/3))/36 + sqrt(3)*(4
*d + f + h)*atan(sqrt(3)*(2*x/3 + 1/3))/36 - sqrt(3)*(-2*e + g - 3*i + 1)*atan(s
qrt(3)*(2*x**2/3 + 1/3))/9

_______________________________________________________________________________________

Mathematica [C]  time = 1.42449, size = 243, normalized size = 1.25 \[ \frac{1}{36} \left (\frac{6 \left (-d x^3+d x+2 e x^2+e+2 f x^3+f x-g \left (x^2+2\right )-h x^3-2 h x-i x^2+i\right )}{x^4+x^2+1}-\frac{\tan ^{-1}\left (\frac{1}{2} \left (\sqrt{3}-i\right ) x\right ) \left (\left (\sqrt{3}-11 i\right ) d-2 \left (\sqrt{3}-2 i\right ) f+\left (\sqrt{3}-5 i\right ) h\right )}{\sqrt{\frac{1}{6} \left (1+i \sqrt{3}\right )}}-\frac{\tan ^{-1}\left (\frac{1}{2} \left (\sqrt{3}+i\right ) x\right ) \left (\left (\sqrt{3}+11 i\right ) d-2 \left (\sqrt{3}+2 i\right ) f+\left (\sqrt{3}+5 i\right ) h\right )}{\sqrt{\frac{1}{6} \left (1-i \sqrt{3}\right )}}-4 \sqrt{3} \tan ^{-1}\left (\frac{\sqrt{3}}{2 x^2+1}\right ) (2 e-g+2 i)\right ) \]

Warning: Unable to verify antiderivative.

[In]  Integrate[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(1 + x^2 + x^4)^2,x]

[Out]

((6*(e + i + d*x + f*x - 2*h*x + 2*e*x^2 - i*x^2 - d*x^3 + 2*f*x^3 - h*x^3 - g*(
2 + x^2)))/(1 + x^2 + x^4) - (((-11*I + Sqrt[3])*d - 2*(-2*I + Sqrt[3])*f + (-5*
I + Sqrt[3])*h)*ArcTan[((-I + Sqrt[3])*x)/2])/Sqrt[(1 + I*Sqrt[3])/6] - (((11*I
+ Sqrt[3])*d - 2*(2*I + Sqrt[3])*f + (5*I + Sqrt[3])*h)*ArcTan[((I + Sqrt[3])*x)
/2])/Sqrt[(1 - I*Sqrt[3])/6] - 4*Sqrt[3]*(2*e - g + 2*i)*ArcTan[Sqrt[3]/(1 + 2*x
^2)])/36

_______________________________________________________________________________________

Maple [B]  time = 0.018, size = 374, normalized size = 1.9 \[{\frac{1}{4\,{x}^{2}+4\,x+4} \left ( \left ( -{\frac{d}{3}}-{\frac{h}{3}}-{\frac{e}{3}}-{\frac{g}{3}}+{\frac{2\,f}{3}}+{\frac{2\,i}{3}} \right ) x-{\frac{2\,d}{3}}+{\frac{h}{3}}+{\frac{e}{3}}-{\frac{2\,g}{3}}+{\frac{f}{3}}+{\frac{i}{3}} \right ) }+{\frac{d\ln \left ({x}^{2}+x+1 \right ) }{4}}-{\frac{\ln \left ({x}^{2}+x+1 \right ) f}{8}}+{\frac{\ln \left ({x}^{2}+x+1 \right ) h}{8}}+{\frac{d\sqrt{3}}{9}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{2\,\sqrt{3}e}{9}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}f}{36}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}g}{9}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}h}{36}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{2\,\sqrt{3}i}{9}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{1}{4\,{x}^{2}-4\,x+4} \left ( \left ({\frac{d}{3}}+{\frac{h}{3}}-{\frac{e}{3}}-{\frac{g}{3}}-{\frac{2\,f}{3}}+{\frac{2\,i}{3}} \right ) x-{\frac{2\,d}{3}}+{\frac{h}{3}}-{\frac{e}{3}}+{\frac{2\,g}{3}}+{\frac{f}{3}}-{\frac{i}{3}} \right ) }-{\frac{d\ln \left ({x}^{2}-x+1 \right ) }{4}}+{\frac{\ln \left ({x}^{2}-x+1 \right ) f}{8}}-{\frac{\ln \left ({x}^{2}-x+1 \right ) h}{8}}+{\frac{d\sqrt{3}}{9}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{2\,\sqrt{3}e}{9}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}f}{36}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }-{\frac{\sqrt{3}g}{9}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}h}{36}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{2\,\sqrt{3}i}{9}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1)^2,x)

[Out]

1/4*((-1/3*d-1/3*h-1/3*e-1/3*g+2/3*f+2/3*i)*x-2/3*d+1/3*h+1/3*e-2/3*g+1/3*f+1/3*
i)/(x^2+x+1)+1/4*d*ln(x^2+x+1)-1/8*ln(x^2+x+1)*f+1/8*ln(x^2+x+1)*h+1/9*d*arctan(
1/3*(1+2*x)*3^(1/2))*3^(1/2)-2/9*3^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*e+1/36*3^(1
/2)*arctan(1/3*(1+2*x)*3^(1/2))*f+1/9*3^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*g+1/36
*3^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*h-2/9*3^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*i
-1/4*((1/3*d+1/3*h-1/3*e-1/3*g-2/3*f+2/3*i)*x-2/3*d+1/3*h-1/3*e+2/3*g+1/3*f-1/3*
i)/(x^2-x+1)-1/4*d*ln(x^2-x+1)+1/8*ln(x^2-x+1)*f-1/8*ln(x^2-x+1)*h+1/9*3^(1/2)*a
rctan(1/3*(2*x-1)*3^(1/2))*d+2/9*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*e+1/36*3^(1
/2)*arctan(1/3*(2*x-1)*3^(1/2))*f-1/9*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*g+1/36
*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*h+2/9*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*i

_______________________________________________________________________________________

Maxima [A]  time = 0.77894, size = 209, normalized size = 1.08 \[ \frac{1}{36} \, \sqrt{3}{\left (4 \, d - 8 \, e + f + 4 \, g + h - 8 \, i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{1}{36} \, \sqrt{3}{\left (4 \, d + 8 \, e + f - 4 \, g + h + 8 \, i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + \frac{1}{8} \,{\left (2 \, d - f + h\right )} \log \left (x^{2} + x + 1\right ) - \frac{1}{8} \,{\left (2 \, d - f + h\right )} \log \left (x^{2} - x + 1\right ) - \frac{{\left (d - 2 \, f + h\right )} x^{3} -{\left (2 \, e - g - i\right )} x^{2} -{\left (d + f - 2 \, h\right )} x - e + 2 \, g - i}{6 \,{\left (x^{4} + x^{2} + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 + x^2 + 1)^2,x, algorithm="maxima")

[Out]

1/36*sqrt(3)*(4*d - 8*e + f + 4*g + h - 8*i)*arctan(1/3*sqrt(3)*(2*x + 1)) + 1/3
6*sqrt(3)*(4*d + 8*e + f - 4*g + h + 8*i)*arctan(1/3*sqrt(3)*(2*x - 1)) + 1/8*(2
*d - f + h)*log(x^2 + x + 1) - 1/8*(2*d - f + h)*log(x^2 - x + 1) - 1/6*((d - 2*
f + h)*x^3 - (2*e - g - i)*x^2 - (d + f - 2*h)*x - e + 2*g - i)/(x^4 + x^2 + 1)

_______________________________________________________________________________________

Fricas [A]  time = 6.3613, size = 387, normalized size = 1.99 \[ \frac{\sqrt{3}{\left (3 \, \sqrt{3}{\left ({\left (2 \, d - f + h\right )} x^{4} +{\left (2 \, d - f + h\right )} x^{2} + 2 \, d - f + h\right )} \log \left (x^{2} + x + 1\right ) - 3 \, \sqrt{3}{\left ({\left (2 \, d - f + h\right )} x^{4} +{\left (2 \, d - f + h\right )} x^{2} + 2 \, d - f + h\right )} \log \left (x^{2} - x + 1\right ) + 2 \,{\left ({\left (4 \, d - 8 \, e + f + 4 \, g + h - 8 \, i\right )} x^{4} +{\left (4 \, d - 8 \, e + f + 4 \, g + h - 8 \, i\right )} x^{2} + 4 \, d - 8 \, e + f + 4 \, g + h - 8 \, i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + 2 \,{\left ({\left (4 \, d + 8 \, e + f - 4 \, g + h + 8 \, i\right )} x^{4} +{\left (4 \, d + 8 \, e + f - 4 \, g + h + 8 \, i\right )} x^{2} + 4 \, d + 8 \, e + f - 4 \, g + h + 8 \, i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) - 4 \, \sqrt{3}{\left ({\left (d - 2 \, f + h\right )} x^{3} -{\left (2 \, e - g - i\right )} x^{2} -{\left (d + f - 2 \, h\right )} x - e + 2 \, g - i\right )}\right )}}{72 \,{\left (x^{4} + x^{2} + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 + x^2 + 1)^2,x, algorithm="fricas")

[Out]

1/72*sqrt(3)*(3*sqrt(3)*((2*d - f + h)*x^4 + (2*d - f + h)*x^2 + 2*d - f + h)*lo
g(x^2 + x + 1) - 3*sqrt(3)*((2*d - f + h)*x^4 + (2*d - f + h)*x^2 + 2*d - f + h)
*log(x^2 - x + 1) + 2*((4*d - 8*e + f + 4*g + h - 8*i)*x^4 + (4*d - 8*e + f + 4*
g + h - 8*i)*x^2 + 4*d - 8*e + f + 4*g + h - 8*i)*arctan(1/3*sqrt(3)*(2*x + 1))
+ 2*((4*d + 8*e + f - 4*g + h + 8*i)*x^4 + (4*d + 8*e + f - 4*g + h + 8*i)*x^2 +
 4*d + 8*e + f - 4*g + h + 8*i)*arctan(1/3*sqrt(3)*(2*x - 1)) - 4*sqrt(3)*((d -
2*f + h)*x^3 - (2*e - g - i)*x^2 - (d + f - 2*h)*x - e + 2*g - i))/(x^4 + x^2 +
1)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4+x**2+1)**2,x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.275638, size = 228, normalized size = 1.18 \[ \frac{1}{36} \, \sqrt{3}{\left (4 \, d + f + 4 \, g + h - 8 \, i - 8 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{1}{36} \, \sqrt{3}{\left (4 \, d + f - 4 \, g + h + 8 \, i + 8 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + \frac{1}{8} \,{\left (2 \, d - f + h\right )}{\rm ln}\left (x^{2} + x + 1\right ) - \frac{1}{8} \,{\left (2 \, d - f + h\right )}{\rm ln}\left (x^{2} - x + 1\right ) - \frac{d x^{3} - 2 \, f x^{3} + h x^{3} + g x^{2} + i x^{2} - 2 \, x^{2} e - d x - f x + 2 \, h x + 2 \, g - i - e}{6 \,{\left (x^{4} + x^{2} + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 + x^2 + 1)^2,x, algorithm="giac")

[Out]

1/36*sqrt(3)*(4*d + f + 4*g + h - 8*i - 8*e)*arctan(1/3*sqrt(3)*(2*x + 1)) + 1/3
6*sqrt(3)*(4*d + f - 4*g + h + 8*i + 8*e)*arctan(1/3*sqrt(3)*(2*x - 1)) + 1/8*(2
*d - f + h)*ln(x^2 + x + 1) - 1/8*(2*d - f + h)*ln(x^2 - x + 1) - 1/6*(d*x^3 - 2
*f*x^3 + h*x^3 + g*x^2 + i*x^2 - 2*x^2*e - d*x - f*x + 2*h*x + 2*g - i - e)/(x^4
 + x^2 + 1)